﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Roslyn.Compilers.CSharp;

namespace RoslynHelper
{
    public static class PropertyDeclaration
    {
        public static PropertyDeclarationSyntax DefineAccessors(this PropertyDeclarationSyntax node, AccessorDeclarationSyntax get, AccessorDeclarationSyntax set)
        {
            return Syntax.PropertyDeclaration(
                attributes: node.Attributes,
                modifiers: node.Modifiers,
                type: node.Type,
                explicitInterfaceSpecifierOpt: node.ExplicitInterfaceSpecifierOpt,
                identifier : node.Identifier, 
                accessorList: Syntax.AccessorList(
                    accessors: Syntax.List<AccessorDeclarationSyntax>(get, set)));
        }
    }
}
